package niuke;

import java.util.Scanner;

public class 牛牛吃雪糕 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int a[][] = new int[n][4];
        for(int i=0;i<n;i++){
            a[i][0] = scanner.nextInt();
            a[i][1] = scanner.nextInt();
            a[i][2] = scanner.nextInt();
            a[i][3] = scanner.nextInt();
        }

        for(int i=0;i<n;i++){
            System.out.println(f(a[i]));
        }
    }

    public static String f(int a[]){
        int sum = 0;
        //计算3盒装的雪糕
        sum = sum + a[3]/2;
        a[3] = a[3]%2;
        if(a[3]>0 && a[1]>0 && a[2]>0){
            sum = sum + 1;
            a[3] --;
            a[2] --;
            a[1] --;
        }
        else if(a[3]>0 && a[1]>=3){
            sum = sum+1;
            a[3]--;
            a[1] = a[1] - 3;
        }

        //计算两盒装的
        sum = sum + a[2]/3;
        a[2] = a[2]%3;
        if(a[2]>0 && a[1]>=2){
            if(a[1]>=4){
                sum = sum + a[2];
                a[2] = 0;
                a[1] = a[1] - (a[2]==2 ? 2 : 4);
            }else if(a[2]==2) {
                sum = sum+2;
                a[1] = a[1]-2;
            }
        }

        //1盒装
        sum = sum + a[1]/6;
        if(sum>=a[0]){
            return "Yes";
        }else {
            return "No";
        }
    }
}
